/*
 * @Author: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @Date: 2024-06-20 10:41:48
 * @LastEditors: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @LastEditTime: 2024-06-20 16:35:00
 * @FilePath: \cq-admin-vue3\src\api\awaitList.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'
//分页查询
export const getData = (data) => {
  return request({
    url: 'queue/all',
    method: 'get',
    params: {
      page: data.page,
      pageSize: data.pageSize
    }
  })
}

//搜索
export const searchData = (title) => {
  return request({
    url: 'queue/title',
    method: 'get',
    params: {
      title
    }
  })
}

//删除
export const delData = (id) => {
  return request({
    url: `queue/${id}`,
    method: 'delete'
  })
}

//添加
export const addData = (data) => {
  return request({
    url: 'queue',
    method: 'post',
    data
  })
}

//修改
export const changeData = (data) => {
  return request({
    url: 'queue',
    method: 'put',
    data
  })
}

//复检or入库
export const checkOrInput = (data) => {
  return request({
    url: 'queue/deposit',
    method: 'post',
    data
  })
}

//上传图片
export const uploadImg = (file) => {
  return request({
    url: 'queue/upload',
    'Content-Type': 'multipart/form-data',
    method: 'post',
    data: file
  })
}

//根据ID查询
export const getDataById = (id) => {
  return request({
    url: `queue/${id}`,
    method: 'get'
  })
}

//根据类别ID查询
export const getDataByCateId = (id) => {
  return request({
    url: `queue/category`,
    method: 'get',
    params: {
      categoryId: id
    }
  })
}
//根据state搜索
export const getDataByStatus = (id) => {
  return request({
    url: `queue//status`,
    method: 'get',
    params: {
      storageStatus: id
    }
  })
}
